package com.huidian.resource.client.enums;

import static com.huidian.cache.config.CacheManagerConfig.CACHE_CALC_KEYS_METHOD;
import static com.huidian.cache.config.CacheManagerConfig.CAFF_CACHE_MANAGER;
import static com.huidian.cache.config.CacheManagerConfig.REDIS_CACHE_MANAGER;

/**
 * em_embasic 库，DTU网关，仪表，仪表型号，仪表类型采集属性，电价格，仪表类型配置等cache相关配置
 * @author tjs
 */

public interface EmBaseCacheDef {

    String EM_METER_ID_KEY = "meterId";

    String EM_METER_ID_CACHE = "meter";

    String EM_METER_INDEX_CACHE = "meterIndex";

    String EM_METER_INDEX_KEY = "gwId,asId,iotId-slave";

    String EM_METER_CACHE_MANAGER = REDIS_CACHE_MANAGER;

    String EM_METER_CACHE_DEL_METHOD = CACHE_CALC_KEYS_METHOD;


    /**
     *  资源表 em_embasic.em_gatewaay cache相关配置信息
     *  资源表，主键id
     */
    String EM_GATEWAY_ID_KEY = "gwId";

    /**
     * cacheName ,id缓存名称
     *  emGateway.put(65,emGateWayResp)
     */
    String EM_GATEWAY_ID_CACHE = "emGateway";

    /**
     * cacheName ,索引缓存名称
     *
     */
    String EM_GATEWAY_INDEX_CACHE = "emGatewayIndex";

    /**
     *  emGatewayIndex.put("iotId:a62dxPBHMa6Pdz2KghAq000100",List<emGateWayResp>)
     *  emGatewayIndex.put("productKey:a1ticsEOIvb:deviceName:sem_tjyt_zj_1",List<emGateWayResp>)
     */
    String EM_GATEWAY_INDEX_KEY = "iotId,productKey-deviceName";

    /**
     *  设置资源对应的 cache管理类，便于切换最终的存储介质(CAFF_CACHE_MANAGER:jvm节点内存中,REDIS_CACHE_MANAGER:分布式redis中)
     */
    String EM_GATEWAY_CACHE_MANAGER = CAFF_CACHE_MANAGER;


    /**
     *  在CREATE,UPDATE,DELETE资源的时候，计算资源关联的cache key列表来删除redis,或者jvm节点内的caff cache,便于业务节点下次重新获取到变更后的资源信息。
     */
    String EM_GATEWAY_CACHE_DEL_METHOD = CACHE_CALC_KEYS_METHOD;


    String STUDENT_ID_KEY = "stdId";

    String STUDENT_ID_CACHE = "student";

    String STUDENT_INDEX_CACHE = "studentIndex";

    String STUDENT_PAGE_CACHE = "studentPage";

    String STUDENT_INDEX_KEY = "schoolId,countyId";

    String STUDENT_CACHE_MANAGER = REDIS_CACHE_MANAGER;

    String STUDENT_CACHE_DEL_METHOD = CACHE_CALC_KEYS_METHOD;

}